﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" namespace="PetShop.Domain.Model"
				   assembly="PetShop">

	<class name="ProductEntity" table="Product" >

		<id name="Id" column="ProductId" type="System.String">
			<generator class="assigned"/>
		</id>

		<property name="Description" column="Descn" access="field.pascalcase-underscore" not-null="false" type="System.String"  length="255" insert="true" update="true"/>
		<property name="Name" column="Name" access="field.pascalcase-underscore" not-null="false" type="System.String"  length="80" insert="true" update="true"/>
		
		<many-to-one name="Category"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
			<column name="Category"/>
		</many-to-one>

		<bag name="ListItems" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
			<key>
				<column name="ProductId"/>
			</key>
			<one-to-many class="ItemEntity"/>
		</bag>

	</class>
</hibernate-mapping>

